package com.atguigu.gmall.juc;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/5/31 15:58
 */
public class LockTest {
    static ReentrantLock reentrantLock = new ReentrantLock();
    public static void main(String[] args) {
        try{
           reentrantLock.lock();
           System.out.println("任务被执行了");
        }finally {
           reentrantLock.unlock();
        }
    }
}
